package com.cy.cykh.app.view.fragment

import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.support.v4.app.DialogFragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.cy.cykh.app.cdyapp.R


/**
 * Created by caik on 2017/6/6.
 */
class ProgressFragment :DialogFragment(){

    companion object{
        fun newInstance(): ProgressFragment{
            return ProgressFragment()
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setStyle(DialogFragment.STYLE_NO_TITLE, R.style.progress_dialog)
    }
    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?): View? {
    // dialog.window.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        //按对话框以外的地方不起作用。按返回键还起作用
        dialog.setCanceledOnTouchOutside(false)
        //调用这个方法时，按对话框以外的地方不起作用。按返回键也不起作用
       // dialog.setCancelable(false)
      val  rootView = inflater.inflate(R.layout.layout_fg_dialog, container, false)
        return rootView
    }
}